package com.lanju.app.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import com.dxl.dao.common.BaseDao;
import com.lanju.app.message.bean.BaseRequest;
import com.lanju.app.message.bean.BaseResponse;
import com.lanju.entity.User;

public abstract class BaseService<T extends BaseRequest,E extends BaseResponse> implements AppService<T, E>{
	
	@Autowired
	@Qualifier("baseDao")
	protected  BaseDao dao;
	
	@Override
	public User getUser(String id){
		return dao.get(User.class, id);
	}
	
	/**
	 * 处理业务
	 * @param company 请求公司
	 * @param request
	 * @return
	 */
	@Override
	public abstract E doService(T request, User user) throws Exception;
}
